import threading
import datetime
import time

def ttt():
    print("run")

def cost_func():
    print(datetime.datetime.now())
    timer = threading.Timer(5, ttt)
    timer.start()
    print("---------------begin--------------")
    # 实时计算当前秒内各订单在多对一情形下被应答的概率（考虑到有订单在应答过程中被取消的情形）

    # 轮盘赌

    # 选择订单逻辑
    time.sleep(6)
    timer.cancel()
    print("--------------finish--------------")

cost_func()



